package com.bbx.taxi.client.Util;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

import com.bbx.androidapi.util.ToastUtil;
import com.bbx.api.sdk.model.passanger.Return.MyOrderList.MyOrderList;
import com.bbx.taxi.client.Activity.Main.MainActivity;
import com.bbx.taxi.client.Activity.Order.OrderEvaluationActivity2;
import com.bbx.taxi.client.Bean.Value;
import com.bbx.taxi.client.Bean.Attribute.MainAttribute;
import com.bbx.taxi.client.Bean.Extra.MainMsg;
import com.bbx.taxi.client.Util.VersionUtils.VersionType;

/**
 * @Path com.bbx.taxi.client.Util.AgainOrder.java
 * @Author 严旭文
 * @Date 2016-12-5 下午2:14:04
 * @Company 蓝海（福建）信息技术有限公司
 * @Description 再次下单
 */
public class AgainOrder {
	/**
	 * @param activity
	 * @param mMyOrderList
	 * @param viewId
	 *            再次下单
	 */
	public static void onAgainOrder(Context context, MyOrderList mMyOrderList,
			int viewId) {
		try {
			if (mMyOrderList.getOrder_type() == Value.ORDER_TYPE_KJ&&VersionUtils.getVersionType(context)==VersionType.tianshang) {
                ToastUtil.showToast(context, "未开通小件快递业务");
			}else{
				MainAttribute main = MainAttribute.getInstance();
				main.setAttribute(mMyOrderList);
				Intent intent = new Intent();
				intent.setClass(context, MainActivity.class);
				intent.putExtra(MainMsg.extra_viewpageId, viewId);
				intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // 注意本行的FLAG设置
				context.startActivity(intent);
			}
		} catch (Exception e) {
			ToastUtil.showToast(context, "异常");
		}
	}
}
